package com.liu.hooks;

import com.liu.util.TrackerLoger;

import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;

public class DexLoaderHook extends AbstractHook {

	public static final String TAG = "#DexLoaderHook#";
	
	public static final String TYPE = "com.liu.hooks.DexLoaderHook";
	
	public XC_MethodHook dexClassLoaderHook = new XC_MethodHook() {
		@Override
		protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
			
			TrackerLoger.log(TAG, "[init]" + param.args[0], TYPE, true);
			
		}
	};
	
	@Override
	public void doHook() {
		//XposedHelpers.findAndHookConstructor(DexClassLoader.class, String.class, String.class, String.class, ClassLoader.class, dexClassLoaderHook);
		XposedHelpers.findAndHookConstructor("com.secneo.guard.MyClassLoader", classloader, String.class, String.class, String.class, ClassLoader.class, dexClassLoaderHook);
	}

	@Override
	public void setClassLoader(ClassLoader classloader) {
		// TODO Auto-generated method stub
		this.classloader = classloader;
	}

}
